package com.hsd.whb.repository;

import com.hsd.whb.entity.Device;
import com.hsd.whb.entity.Recorder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RecorderRepository extends JpaRepository<Recorder, Integer> {

    Recorder findByUsername(String username);

    Recorder findByWorkNumber(String workNumber);

    Recorder findByPhone(String phone);

    Recorder findByEmail(String email);

    List<Recorder> findByUsernameLikeAndDeleted(String username, Integer deleted);

    @Query("select id from Recorder where username like %?1%")
    List<Integer> findIdByUsernameLike(String username);

}
